1. Field of the Invention
The present invention relates to a method of and a system for transforming a color image to a monochrome image and a recording medium with a computer program for implementing transformation of a color image to a monochrome image.
2. Description of Related Art
In an extraction process of extracting a specific part from a color image, it is important to discriminate a specific area from the color image. It is popular to recognize a specific area of an image as a partial image having even characteristic values of color density, color, texture and the like. A technique of discriminating an image area from an entire image on the basis of color components as characteristic values is widely used in various industrial fields. In, for example, a food industry or a chemical industry, the image area discrimination technique is used in image discriminating devices for position inspection of a color label on a product, devices for screening products by recognizing a color bar printed on the product or a package of the product in a combined manufacturing line, and the like.
In such a device, an image pick-up device such as a color camera is used to pick up a color image of a subject product. The color image is transmitted to an image processing device in the form of analogue signals of three primary colors of picture elements of a color image, namely R (red), G (green) and B (blue) analogue image signals, which are then converted to R, G and B digital image signals and stored in a memory. The image processing device processes the R, G and B digital signals to display a color image on a display such as a cathode ray tube (CRT). For extraction of a color in the color image, one of the colors is selected on a color pallet by a mouse pointer, or a color for extraction is designated by R, G and B brightness values through a data entry device. Otherwise a color for extraction is designated by selecting directly one or more picture elements that have the color for extraction. When a color for extraction is determined, threshold levels are established to sort out picture elements having R, G and B brightness less than the threshold levels, respectively, for consistency in color with the extracted color. Areas enclosing the picture elements that are identified as having colors regarded consistent with the extracted color are given a specific brightness value of 0 (zero) or 1 (one), and the remaining areas are given a specific brightness value of 1 (one) or 0 (zero) so as to convert the color image to binary brightness data. In an area of the color image either one of the brightness values 0 and 1 is displayed on the CRT screen. In this image discriminating technique, when picking up an image of a color label attached to a rounded subject such as a chemical tube by a camera, light rays usually impinge against the subject at an angle, so as to illuminate unevenly over the color label. As a result, the color label shows shades, which make it impossible to recognize the entire area of the color label to be consistent in color, so that extraction of the entire area of the color label is not consistent. Further, when establishing high threshold levels for R, G and B brightness values for extraction of the entire area of a color label, there is the apprehension that an unnecessary area is possibly extracted. Further, uneven illumination causes uneven brightness distribution over a subject, which results in extraction of patchy areas. When establishing high threshold levels for R, G and B brightness values for extraction of the entire area of the subject, there is also the apprehension that an unnecessary area is possibly extracted.
In order to eliminate these problems, there has been proposed a technique of discriminating an image area from an entire image in which the utilization is made of three attributes of color. Specifically, R, G and B digital image signals converted from R, G and B analogue image signals of picture elements of an image of a subject are converted to three attribute values of color, namely, values relating to hue (H), saturation (S) and brightness (I). For extraction of a color in the color image, one of colors is selected on a color pallet by a mouse pointer, or a color for extraction is designated by R, G and B brightness values through a data entry device, or otherwise, a color for extraction is designated by selecting directly one or more picture elements that have the color for extraction. When a color for extraction is determined, threshold levels are established to sort out picture elements having H, S and I values less than the threshold levels, respectively, for consistency in color with the extracted color. Areas enclosing the picture elements that are identified as having colors regarded consistent with the extracted color is extracted and displayed on a CRT screen. The color image extraction provides a precise color appraisal with components of a color tone of a subject that is not affected by uneven illumination. Such a color image extraction is known from, for example, Japanese Unexamined Patent Publication No. 4-10075.
This color image extraction disclosed by the publication has the necessity of converting R, G and B brightness values to H, S and I values, so as to make the system construction complicated and to require intricate operation, which is always undesirable for improvement of operation speed. Further, on the grounds that, when the threshold level has been established once, an extraction area is unconditionally determined, it is hard to establish a threshold level suitable for a precise extraction of a desired area.
It is therefore an object of the present invention to provide a method of and apparatus for transforming a color image to a monochrome image in which utilization is made of an extent of color consistency defined by R, G and B brightness values and at least one of brightness disparities of respective couples of two primary colors of each color picture element of a color image so as to execute high speed image processing of a color image that even includes shades or areas having uneven brightness due to uneven illumination, and to transform the color image to a monochrome image that enables an operator to make a precise extraction of a desired area from the monochrome image.
It is another object of the present invention to provide a method of and apparatus for transforming a color image to a monochrome image which make it easy to recognize an extraction area in a monochrome image and to change an extraction area.
It is still another object of the present invention to provide a method of and apparatus for transforming a color image to a monochrome image which makes it possible to execute a precise extraction of black area in a monochrome image.
It is a further object of the present invention to provide a record medium which bears a program for causing a computer to operate an apparatus for transforming a color image to a monochrome image for establishing an extent of color consistency defined by R, G and B brightness values and at least one of brightness disparities of respective couples of two primary colors of each color picture element of a color image, executing high speed image processing of a color image that even includes shades or areas having uneven brightness due to uneven illumination, and transforming the color image to a monochrome image that enables an operator to make a precise extraction of a desired area from the monochrome image.
The foregoing objects of the present invention are accomplished by a method of transforming a color image to a monochrome image on the basis of values relating to brightness of three primary colors, namely red (R), green (G) and blue (B), of the color image which comprises the steps of: detecting R, G and B brightness of color picture elements of a color image; computing at least one of brightness disparities (Rxe2x88x92B), (Rxe2x88x92G) and (Bxe2x88x92G) of respective couples of two primary colors of each color picture element; designating at least one of the color picture elements or a cluster of picture elements; defining an extent of color consistency relating to a color of the designated color picture element on the basis of the B, G and R brightness and the brightness disparity, for example (Rxe2x88x92B), of the designated color picture element; determining R, G and B brightness values and a brightness disparity (Rxe2x88x92B) value according to differences of the R, G and B brightness and the brightness disparity (Rxe2x88x92B) of each color picture element from the extent of color consistency; and forming a monochrome image consisting of monochrome picture elements each of which has brightness in conformity with a total value of the R, G and B brightness values and the brightness disparity (Rxe2x88x92B) value of the color picture element corresponding to the monochrome picture element.
A brightness value of a monochromatic picture element is set at 0 (zero) when the monochromatic picture element has a brightness disparity value smaller than a predetermined threshold brightness disparity value or at a total value of R, G and B color brightness values and a value relating to the brightness disparity value when the monochromatic picture element has a brightness disparity value greater than the predetermined brightness disparity threshold value. A monochrome picture element may be given a predetermined brightness value when the monochromatic picture element has B, G and R brightness values greater than three predetermined primary color brightness threshold values, respectively.
According to another embodiment of the present invention, the method of transforming a color image to a monochrome image comprises the steps of: detecting R, G and B brightness of color picture elements of a color image; computing at least one of brightness disparities (Rxe2x88x92B), (Rxe2x88x92G) and (Bxe2x88x92G) of respective couples of two primary colors of each color picture element; designating an area of the color image; defining an extent of color consistency on the basis of the R, G and B brightness and at least one of the brightness disparities (Rxe2x88x92B), (Rxe2x88x92G) and (Bxe2x88x92G) of the color picture elements enclosed in the designated area; determining R, G and B brightness values and a brightness disparity value according to differences of the R, G and B brightness and the brightness disparity (Rxe2x88x92B), (Rxe2x88x92G) or (Bxe2x88x92G) of each color picture element from the extent of color consistency; and forming a monochrome image consisting of monochrome picture elements each of which has brightness in conformity with a total value of the R, G and B brightness values and the brightness disparity (Rxe2x88x92B), (Rxe2x88x92G) or (Bxe2x88x92G) value of the color picture element corresponding to the monochrome picture element.
The foregoing objects of the present invention are further accomplished by a system for transforming a color image to a monochrome image which comprises; brightness detecting means for detecting R, G and B brightness of color picture elements of a color image; area designating means for designating at least one of the color picture elements; processing means for computing at least one of brightness disparities (Rxe2x88x92B), (Rxe2x88x92G) and (Bxe2x88x92G) of respective couples of two primary colors of each color picture element, defining an extent of color consistency relating to a color of the designated color picture element on the basis of the R, G and B brightness and the brightness disparity of the designated color picture element, and determining R, G and B brightness values and a brightness disparity value according to differences of the R, G and B brightness and the brightness disparity of each color picture element from the extent of color consistency; and display means for displaying a monochrome image consisting of monochrome picture elements each of which has brightness in conformity with a total value of the R, G and B brightness values and the brightness disparity (Rxe2x88x92B), (Rxe2x88x92G) or (Bxe2x88x92G) value of the color picture element corresponding to the monochrome picture element.
The color image transforming system sets a brightness value of a monochromatic picture element at 0 (zero) when the monochromatic picture element has a brightness disparity value smaller than a predetermined threshold brightness disparity value, or at a total value of the R, G and B brightness values and a value relating to the brightness disparity value when the monochromatic picture element has a brightness disparity value greater than the predetermined brightness disparity threshold value. The color image transforming system may give a monochrome picture element a predetermined brightness value when the monochromatic picture element has the R, G and B brightness values greater than predetermined R, G and B brightness threshold values, respectively.
According to another embodiment of the present invention, a color image transforming system comprises: brightness detecting means for detecting R, G and B brightness values of color picture elements of a color image; area designating means for designating an area of the color image; processing means for computing at least one of brightness disparities Rxe2x88x92B, Rxe2x88x92G and Bxe2x88x92G (which are hereafter referred to as RB, RG and BG brightness disparities) of respective couples of two primary colors of each color picture element, defining an extent of color consistency on the basis of the R, G and B brightness and the RB, RG or BG brightness disparities of the color picture elements enclosed in the designated area, and determining R, G and B brightness values and a RB, RG or BG brightness disparity according to differences of the R, G and B brightness and the RB, RG or BG brightness disparity of each color picture element from the extent of color consistency; and display means for displaying a monochrome image consisting of monochrome picture elements each of which has brightness in conformity with a total value of the R, G and B brightness values and the RB, RG or BG brightness disparity of the color picture element corresponding to the monochrome picture element.
In the above embodiments, the extent of color consistency may be established so as to enclose the color of the designated color picture element. Otherwise, the extent of color consistency may be defined within an extent of color enclosing the color of the designated color picture element.
The foregoing object of the present invention is accomplished by a record medium with a program which a computer reads out to operate to implement a transformation of a color image to a monochrome image on the basis of R, G and B brightness values and which comprises a program code for computation of at least one of RB, RG and BG brightness disparities of respective couples of two primary colors of each of color picture elements of a color image, a program code for defining an extent of color consistency relating to a color of a designated color picture element of the color image on the basis of the R, G and B brightness values and the RB, RG or BG brightness disparity of the designated color picture element, a program code for determining R, G and B attributive values and at least one of RB, RG and BG attributive values according to deviations of the R, G and B brightness values and the RB, RG or BG brightness disparity of each color picture element from the extent of color consistency, and a program code for computing a total of the R, G and B brightness values and the RB, RG or BG brightness disparity of each color picture element as a picture element attributive value in conformity with which brightness of each monochrome picture element of a monochrome image is determined.
With the color image transforming method and system, and the utilization of at least one of the RB, RG and BG brightness disparities in addition to R, G and B brightness values as parameters for a color extraction, an image of a subject that even has shades or is unevenly illuminated is transformed to a monochrome image from which a desired area is precisely extracted. A monochrome image is not limited to a multi-gradation black and white image and may be a mono-color image such as a red image that has only one attribute value such as, for example, a deviation of a brightness value from the extent of color consistency. The extent of color consistency is not limited to one that is defined between upper and lower extreme brightness values and may be defined by a single brightness value.
In the color image transforming method and system, complicated image processing such as HIS conversion is not used but only brightness disparities are computed as values relating to R, G and B brightness, so that, while the color image transforming method and system are simple in structure, they realize improvement of operation speed. Because the monochrome image has brightness which changes with a difference from a color that is designated, an area including a color for extraction is easily visually recognizable and an extraction area can be easily changeable. Moreover, the monochrome image has brightness which becomes large with a difference from an extent of color consistency that is more strict than an extent of color consistency enclosing a designated color. Accordingly, there are colors that fall within the extent of color consistency enclosing the designated color, one of which is close to a color at the middle of the extent of color consistency and another one of which is close to a peripheral color of the extent of color consistency. These colors can be weighted for an image display by establishing the strict extent of color consistency. Accordingly, picture elements having some colors that fall within the extent of color consistency are displayed with different colors, which makes an extraction of area more precise.
When extracting, for example, only characters from a subject of which a half area is white and another half area is green with the black characters, a monochrome image transformed by the conventional image transforming method shows a clear contrast between the white area and the black characters with a significant brightness difference, however, a monochrome image transformed by the image transforming method of the present invention shows the white area and the black characters with a small brightness difference. Specifically, a black picture element has R, G and B brightness values of zero (0), and a RB, RG or BG brightness disparity of zero (0) in consequence. On the other hand, a green picture element has a G brightness value greater than R and G brightness values, so as to have a RB, RG or BG brightness disparity greater than the block picture element. The monochrome image that shows a more clear contrast between the black character and green background is provided by emphasizing more the brightness disparity with a squared disparity, which provides a far more precise extraction of characters.
In the color image transforming method and system which establishes predetermined R, G and B brightness threshold values, respectively, so as to give a monochrome picture element a predetermined brightness value when the monochrome picture element has R, G and B brightness values greater than the predetermined R, G and B brightness threshold values, an image of a subject having an uneven and highly reflective surface and possibly containing highlighted white areas for parts of the subject which are practically not white, a precise extraction of a specific color of area of the subject is realized.